ruby:
  nested      ||= false
  title       ||= @klass_humanized.pluralize.titleize
  new_button    = !local_assigns[:new_button].eql?(false)
  new_path    ||= "new_#{fae_path}_#{@klass_singular}_path"
  button_text ||= t('fae.common.add', title: title.singularize)
  export_text ||= t('fae.common.csv_export')
  csv         ||= false
  breadcrumb    = !local_assigns[:breadcrumbs].eql?(false)

header.content-header.js-content-header
  - if breadcrumb
    == render 'breadcrumb'
  - else
    h1 = title

  .content-header-buttons
    - if csv && @items.present?
      a.button href="#{@index_path}.csv" = export_text

    - if new_button
      - if nested
        a.add-button.js-add-link.js-index-add-link remote='true' href=self.send(new_path) = button_text
      - else
        a.add-button href=@new_path = button_text

== render 'flash_messages'
